#include<bits/stdc++.h>

using namespace std;

#define rep(i,a,b) for(int i=(a),ed##i=(b);i<=ed##i;++i)
#define per(i,a,b) for(int i=(a),ed##i=(b);i>=ed##i;--i)
#define re(i,a) rep(i,1,a)
#define umod(x) (((x)>=mo)&&((x)-=mo))
#define dmod(x) (((x)<0)&&((x)+=mo))
#define fio(x) (freopen(x".in","r",stdin),freopen(x".out","w",stdout))
#define dbg(x) (cerr<<#x" = "<<(x)<<'\n')

using ll=long long;

const int mo=998244353;
struct Mod{
  int x;
  Mod(ll x=0):x((x%mo+mo)%mo){}

  inline Mod Pow(ll y)const{
    int x=this->x,res=1;
    while(y){
      if(y&1)res=1ll*res*x%mo;
      x=1ll*x*x%mo;
      y>>=1;
    }
    return res;
  }
};

inline Mod operator+(Mod x,Mod y){
  Mod res;
  res.x=x.x+y.x;
  umod(res.x);
  return res;
}

inline Mod operator-(Mod x,Mod y){
  Mod res;
  res.x=x.x-y.x;
  dmod(res.x);
  return res;
}

inline Mod operator*(Mod x,Mod y){
  Mod res;
  res.x=1ll*x.x*y.x%mo;
  return res;
}

inline Mod&operator+=(Mod&x,Mod y){
  x.x+=y.x,umod(x.x);
  return x;
}

inline Mod&operator-=(Mod&x,Mod y){
  x.x-=y.x,dmod(x.x);
  return x;
}

inline Mod&operator*=(Mod&x,Mod y){
  x.x=1ll*x.x*y.x%mo;
  return x;
}

inline Mod operator""_m(unsigned long long x){
  Mod res;
  res.x=x%mo;
  return res;
}

const int N=2e7+9;
int n,m,pri[N];
Mod fac[N],ifac[N],b[N],pw[N];
bool vis[N];

inline void Init(){
  pw[1]=1;
  rep(i,2,m){
    if(!vis[i])pri[++pri[0]]=i,pw[i]=Mod(i).Pow(n);
    re(j,pri[0]){
      if(1ll*i*pri[j]>m)break;
      vis[i*pri[j]]=1;
      pw[i*pri[j]]=pw[i]*pw[pri[j]];
      if(i%pri[j]==0)break;
    }
  }
}

signed main(){
#ifndef LOCAL
  fio("drama");
#endif
  fac[0]=ifac[0]=1;
  re(i,N-1)fac[i]=fac[i-1]*i;
  ifac[N-1]=fac[N-1].Pow(mo-2);
  per(i,N-2,1)ifac[i]=ifac[i+1]*(i+1);
  b[0]=1;
  re(i,N-1){
    if(i&1)
      b[i]=b[i-1]-ifac[i];
    else
      b[i]=b[i-1]+ifac[i];
  }
  cin>>n>>m;
  if(n==1)cout<<"1\n",exit(0);
  swap(n,m);
  Init();
  Mod ans=0;
  re(i,m){
    //ans+=ifac[i]*Mod(i).Pow(n)*b[m-i];
    ans+=ifac[i]*pw[i]*b[m-i];
  }
  cout<<ans.x<<'\n';
  return 0;
}
